How to split the full name into FirstName and LastName in SQL server?
521
15-Oct-2024
Updated on 15-Oct-2024
Ashutosh Kumar Verma
15-Oct-2024To split a
FullNameintoFirstNameandLastNamein SQL Server, you can use string functions like CHARINDEX, LEFT and RIGHT. Here is an example of how you can do this,Assuming you have an SQL table
Employeeswith a columnEmpNamethat contains the name in the format of “FirstName and LastName”,Here is the SQL Query to split the full name into first name and lastname
Example-